<?php

$id = $_GET['id'];
$con = mysqli_connect('localhost', 'root', 'root');
mysqli_select_db($con, '2004');
mysqli_query($con, "set charset 'utf8'");
mysqli_query($con, "set character set 'utf8'");

$sql = "delete from shop where id='$id'";
$resp = mysqli_query($con,$sql);
if ($resp) {
    // 删除成功
    echo json_encode(array(
      "code" => 200,
      "body" => array(
        "msg" => "删除商品成功"
      )
    ));
  } else {
    echo json_encode(array(
      "code" => 0,
      "body" => array(
        "msg" => "网络错误，请重试"
      )
    ));
  }
?>